package com.example.administrator.asdasd;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;

public class Fragment_cz extends Fragment implements View.OnClickListener{
    private ImageButton imBtn1;
    private ImageButton imBtn2;
    private ImageButton imBtn3;
    private ImageButton imBtn4;
    private ImageButton imBtn5;
    private ImageButton imBtn6;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view =inflater.inflate(R.layout.chezhu, container, false);
        imBtn1 = (ImageButton) view.findViewById(R.id.imageButton11);
        imBtn2 = (ImageButton) view.findViewById(R.id.imageButton2);
        imBtn3 = (ImageButton) view.findViewById(R.id.imageButton3);
        imBtn4 = (ImageButton) view.findViewById(R.id.imageButton4);
        imBtn5 = (ImageButton) view.findViewById(R.id.imageButton5);
        imBtn6 = (ImageButton) view.findViewById(R.id.imageButton6);


        imBtn1.setOnClickListener(this);
        imBtn2.setOnClickListener(this);
        imBtn3.setOnClickListener(this);
        imBtn4.setOnClickListener(this);
        imBtn5.setOnClickListener(this);
        imBtn6.setOnClickListener(this);


        return view;
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.imageButton11:
                Intent intent = new Intent(getActivity().getApplicationContext(),Find_cz.class);
                getActivity().startActivity(intent);
                break;
            case R.id.imageButton2:
                Intent intent1 = new Intent(getActivity().getApplicationContext(),Publish_cz.class);
                getActivity().startActivity(intent1);
                break;

            case R.id.imageButton3:
                Intent intent2 = new Intent(getActivity().getApplicationContext(),wu_cheku.class);
                getActivity().startActivity(intent2);
                break;

            case R.id.imageButton4:
                Intent intent3 = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("http://www.all2car.com"));
                getActivity().startActivity(intent3);
                break;

            case R.id.imageButton5:
                Intent intent5 = new Intent(getActivity().getApplicationContext(),dan_cz.class);
                getActivity().startActivity(intent5);
                break;

            case R.id.imageButton6:
                Intent intent4 = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("http://www.china-insurance.com"));
                getActivity().startActivity(intent4);
                break;

        }
    }
}
